package com.sgb.auction.entity;

import android.text.TextUtils;

import com.swgk.core.util.DateUtils;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Time:2021/11/26
 * AUTHOR:F_Q
 * Description:
 */
public class BiddingQueryListEntity implements Serializable {

    private String no;
    private String name;
    private String comNo;
    private String comName;
    private String auctionStartTime;
    private String auctionEndTime;
    private String bidderTime;
    private String price;
    private String unitName;
    private int state;
    private int  again;
    private String highestPrice;
    private String auctionState;

    public String getAuctionState() {
        return auctionState;
    }

    public void setAuctionState(String auctionState) {
        this.auctionState = auctionState;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComNo() {
        return comNo;
    }

    public void setComNo(String comNo) {
        this.comNo = comNo;
    }

    public String getComName() {
        return comName;
    }

    public void setComName(String comName) {
        this.comName = comName;
    }

    public String getAuctionStartTime() {
        if (!TextUtils.isEmpty(auctionStartTime)){
            String timestamp = DateUtils.timestampToDateSecond(Long.parseLong(auctionStartTime));
            return timestamp;
        }else {
            return "";
        }
    }

    public void setAuctionStartTime(String auctionStartTime) {
        this.auctionStartTime = auctionStartTime;
    }

    public String getAuctionEndTime() {
        if (!TextUtils.isEmpty(auctionEndTime)){
            String auctionEndTimes = DateUtils.timestampToDateSecond(Long.parseLong(auctionEndTime));
            return auctionEndTimes;
        }else {
            return "";
        }
    }

    public void setAuctionEndTime(String auctionEndTime) {
        this.auctionEndTime = auctionEndTime;
    }

    public String getBidderTime() {
        return bidderTime;
    }

    public void setBidderTime(String bidderTime) {
        this.bidderTime = bidderTime;
    }

    public String getPrice() {
        if (!TextUtils.isEmpty(price)){
            BigDecimal big = new BigDecimal(price);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getAgain() {
        return again;
    }

    public void setAgain(int again) {
        this.again = again;
    }

    public String getHighestPrice() {
        if (!TextUtils.isEmpty(highestPrice)){
            if (!TextUtils.equals(highestPrice,"--")){
                BigDecimal big = new BigDecimal(highestPrice);
                big = big.stripTrailingZeros();
                return big.toPlainString();
            }else {
                return highestPrice;
            }
        }else {
            return "";
        }
    }

    public void setHighestPrice(String highestPrice) {
        this.highestPrice = highestPrice;
    }
}
